Find the matrix $\mathbf{M},$ with real entries, such that
\[\mathbf{M}^3 - 4 \mathbf{M}^2 + 5 \mathbf{M} = \begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix}.\]
Explanation: Let $\mathbf{M} = \begin{pmatrix} a & b \\ c & d \end{pmatrix}.$  Note that
\[\mathbf{M} (\mathbf{M}^3 - 4 \mathbf{M}^2 + 5 \mathbf{M}) = \mathbf{M}^4 - 4 \mathbf{M}^3 + 5 \mathbf{M}^2 = (\mathbf{M}^3 - 4 \mathbf{M}^2 + 5 \mathbf{M}) \mathbf{M},\]so
\[\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix} = \begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix} \begin{pmatrix} a & b \\ c & d \end{pmatrix}.\]This becomes
\[\begin{pmatrix} 10a + 5b & 20a + 10b \\ 10c + 5d & 20c + 10d \end{pmatrix} = \begin{pmatrix} 10a + 20c & 10b + 20d \\ 5a + 10c & 5b + 10d \end{pmatrix}.\]Comparing entries, we get
\begin{align*}
10a + 5b &= 10a + 20c, \\
20a + 10b &= 10b + 20d, \\
10c + 5d &= 5a + 10c, \\
20c + 10d &= 5b + 10d.
\end{align*}Then from the first and second equations, $5b = 20c$ and $20a = 20d,$ so $b = 4c$ and $a = d.$  (The other equations give us the same information.)  Thus,
\[\mathbf{M} = \begin{pmatrix} a & 4c \\ c & a \end{pmatrix}.\]Then
\[\mathbf{M}^2 = \begin{pmatrix} a & 4c \\ c & a \end{pmatrix} \begin{pmatrix} a & 4c \\ c & a \end{pmatrix} = \begin{pmatrix} a^2 + 4c^2 & 8ac \\ 2ac & a^2 + 4c^2 \end{pmatrix},\]and
\[\mathbf{M}^3 = \begin{pmatrix} a & 4c \\ c & a \end{pmatrix} \begin{pmatrix} a^2 + 4c^2 & 8ac \\ 2ac & a^2 + 4c^2 \end{pmatrix} = \begin{pmatrix} a^3 + 12ac^2 & 12a^2 c + 16c^3 \\ 3a^2 c + 4c^3 & a^3 + 12ac^2 \end{pmatrix}.\]Hence,
\begin{align*}
\mathbf{M}^3 - 4 \mathbf{M}^2 + 5 \mathbf{M} &= \begin{pmatrix} a^3 + 12ac^2 & 12a^2 c + 16c^3 \\ 3a^2 c + 4c^3 & a^3 + 12ac^2 \end{pmatrix} - 4 \begin{pmatrix} a^2 + 4c^2 & 8ac \\ 2ac & a^2 + 4c^2 \end{pmatrix} + 5 \begin{pmatrix} a & 4c \\ c & a \end{pmatrix} \\
&= \begin{pmatrix} a^3 + 12ac^2 - 4a^2 - 16c^2 + 5a & 12a^2 c + 16c^3 - 32ac + 20c \\ 3a^2 c + 4c^3 - 8ac + 5c & a^3 + 12ac^2 - 4a^2 - 16c^2 + 5a \end{pmatrix}
\end{align*}Again comparing entries, we get
\begin{align*}
a^3 + 12ac^2 - 4a^2 - 16c^2 + 5a &= 10, \\
3a^2 c + 4c^3 - 8ac + 5c &= 5.
\end{align*}Then
\[(a^3 + 12ac^2 - 4a^2 - 16c^2 + 5a) - 2 (3a^2 c + 4c^3 - 8ac + 5c) = 0.\]Expanding, we get
\[a^3 - 6a^2 c + 12ac^2 - 8c^3 - 4a^2 + 16ac - 16c^2 + 5a - 10c = 0,\]which we can write as
\[(a - 2c)^3 - 4(a - 2c)^2 + 5(a - 2c) = 0.\]Let $x = a - 2c,$ so
\[x^3 - 4x^2 + 5x = 0,\]which factors as $x(x^2 - 4x + 5) = 0.$  The quadratic factor has no real roots, so $x = 0,$ which means $a = 2c.$

Substituting into the equation $3a^2 c + 4c^3 - 8ac + 5c = 5,$ we get
\[3(2c)^2 c + 4c^3 - 8(2c) c + 5c = 5,\]which simplifies to $16c^3 - 16c^2 + 5c - 5 = 0.$  This factors as $(c - 1)(16c^2 + 5) = 0,$ so $c = 1.$  It follows that $a = 2,$ $b = 4,$ and $d = 2,$ so
\[\mathbf{M} = \boxed{\begin{pmatrix} 2 & 4 \\ 1 & 2 \end{pmatrix}}.\]